<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  function Model(){
    this.data1 = function(){
      return "hello";
    }
    this.data2 = function(){
      return "hi";
    }
    this.data3 = function(){
      return "你好";
    }
  }

  function View(){
    this.view1 = function(d){
      document.write(d);
    }
    this.view2 = function(d){
      console.log(d);
    }
    this.view3 = function(d){
      alert(d);
    }
  }

  function Ctrl(){
    const m = new Model();
    const v = new View();

    this.c1 = function(){
      const d = m.data2();
      v.view3( d );
    }
    this.c2 = function(){
      const d = m.data1();
      v.view2( d );
    }
    this.c3 = function(){
      const d = m.data3();
      v.view1( d );
    }
    this.c4 = function(){
      const d = m.data1();
      v.view1( d );
    }
    this.c5 = function(){
      const d = m.data2();
      v.view2( d );
    }
    this.c6 = function(){
      const d = m.data3();
      v.view3( d );
    }

  }

  const c = new Ctrl();

  // c.c1();
  // c.c2();
  c.c3();

  
</script>
</html>